package com.java.activemq_consumer.consumer;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

import javax.jms.JMSException;
import javax.jms.TextMessage;

/**
 * @author Woo_home
 * @create 2020/5/22 20:59
 */

@Component
public class Queue_Consumer {

    @JmsListener(destination = "${myQueue}")
    public void receive(TextMessage textMessage) throws JMSException {
        System.out.println("****** 消费者收到消息 " + textMessage.getText());
    }
}
